'''
可变参数：**args,**kwargs
装包和拆包
函数装包：
def 函数(*args): --> 此时会出现装包操作
    pass
函数(1,2,3,4)

函数拆包：
list,tuple,set
调用的时候： 函数(*list),函数(*tuple),函数(*set)
'''
# def get_sum(a,b):
#     r = a + b
#     print(r)
# get_sum(2,6,9)
# get_sum(2,6,8,9,10)

# def get_sum1(*args):
#    print(args)
# get_sum1(1,2)
# get_sum1(1,2,3,4,5,6,7,8,9,10)

# a, *b, c = 1, 2, 3, 4, 5
a,b, *c = 1, 2, 3, 4, 5
print(a)
print(b)
print(c)
print('--------------------')
a, b, c = (1, 2, 3)
print(a)
print(b)
print(c)
print('--------------------')
a, b, *c = (1, 2, 3, 4, 5, 6)
print(a)
print(b)
print(c)
print('--------------------')


def get_sum2(*args):
    print(args)
    s = 0
    for i in args:
        s += i
    print('和:', s)

ran_list = [23, 45, 67, 89, 90]
get_sum2(*ran_list)

